<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
	<th:block th:include="include :: header('工时报表')" />
</head>
<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            <div class="col-sm-12 search-collapse m-b">
                <form id="formId" action="/erp/projectHour/report" method="post">
                    <div class="select-list">
                        <ul>

                            <li>
                                <label>节假日：</label>
                                <select name="holidayConfigId"  th:with="type=${@customDictService.selectDictHolidayConfigType()}">
                                    <option th:each="dict : ${type}" th:text="${dict.title}" th:value="${dict.id}"></option>
                                </select>
                            </li>
                            <li class="select-time">
                                <label>开始时间：</label>
                                <input type="text" class="time-input"  id="beginTime" placeholder="请选择开始日期" name="beginDate" th:value="${firstDay}"/>
                                <span>-</span>
                                <input type="text" class="time-input"  id="endTime" placeholder="请选结束时日期" name="endDate" th:value="${lastDay}"/>
                                <span><a  onclick="prevWeek()">上周</a> <a  onclick="nextWeek()">下周</a></span>

                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="submitHandler()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>
        </div>

    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: peity-js" />
    <th:block th:include="include :: sparkline-js" />
    <script type="text/javascript">


        function prevWeek()
        {
            var date = new Date($('#beginTime').val());
            $('#endTime').val($('#beginTime').val());
            date.setDate(date.getDate() - 7);
            $('#beginTime').val(date.getFullYear() + '-' + (date.getMonth()+1) + '-' + date.getDate());
        }
        function nextWeek()
        {
            var date = new Date($('#beginTime').val());
            date.setDate(date.getDate() + 7);
            $('#beginTime').val(date.getFullYear() + '-' + (date.getMonth()+1) + '-' + date.getDate());
            date.setDate(date.getDate() + 7);
            $('#endTime').val(date.getFullYear() + '-' + (date.getMonth()+1) + '-' + date.getDate());
        }

        function submitHandler() {
            $('#formId').submit();
        }
    </script>
</body>
</html>